-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8 upgrade #74
PHP 8 upgrade #74
Conversation
E_NONE is neither a string nor a real constant
Fix later
UNION selects return unique values, resulting in one or the other potentially being null if both results match Fixing the union statement deals with the null value, but probably good to ensure minimums when dividing anyway
@Aokromes I believe this is good to go. |
Made redundant by the Cache-Control header
Also fix favicon convention
@@ -24,7 +24,7 @@ function connect($db_host, $db_username, $db_password, $db_name = NULL, $use_nam | |||
|
|||
if ($this->link_id){ | |||
if (!empty($use_names)) $this->query("SET NAMES '$use_names'"); | |||
} else die($lang_global['err_sql_conn_db']); | |||
} else die($lang_global['err_sql_conn_db'] . " DB: {$db_name}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to make it more clear which database is failing, since the default error language does not make it obvious, and there's several potential culprits
@@ -192,6 +192,7 @@ function top100($realmid, &$sqlr, &$sqlc) | |||
<td>'.char_get_level_color($char['level']).'</td>'; | |||
if ($type === 'level') | |||
{ | |||
// @TODO - fix N+ issue - query inside while loop | |||
$guild_name = $sqlc->result($sqlc->query('SELECT BINARY name AS name FROM guild WHERE guildid = '.$char['gname'].''), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
N+1 query issue here, probably shouldn't be inside the loop. Need to eager load this information elsewhere.
Seems to function fine in PHP 7.4 all the way up to PHP 8.2. Of course 74 is now EOL so folks should move at least to 8.0. This PR fixes a few things that become fatal errors in PHP 8, as well as a few other minor housekeeping changes.
Also adds a docker environment including the two PHP extension dependencies (
php-gp, and mysqli
) as well as PHP 8.0. The mysql init script handles themmftc
database population, but stops short of injecting the DBC.